//
//  ZYCurriculumCashTowSourceCell.m
//  优学荟管理系统
//
//  Created by Ethan on 2017/9/6.
//  Copyright © 2017年 星道三好. All rights reserved.
//

#import "ZYCurriculumCashTowSourceCell.h"
#import "ZYCurriculumCashTowSourceModel.h"
@implementation ZYCurriculumCashTowSourceCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self setUpSuperView];
    }
    
    
    return self;
}


- (void)setAssignZYSourceDetailsModel:(ZYCurriculumCashTowSourceModel *)model{
    
    self.nikeNameLabel.text = [NSString stringWithFormat:@"%@",[model.buyer valueForKey:@"petName"]];
    self.nameLabel.text = [NSString stringWithFormat:@"%@",model.packageName];
    self.priceLabel.text = [NSString stringWithFormat:@"¥%.2f",[model.settlementPrice doubleValue]];
    
    
}


- (void)setUpSuperView{
    
    self.nameLabel = [UILabel new];
    self.nameLabel.numberOfLines = 0;
    self.nameLabel.font = [UIFont systemFontOfSize:14];
    self.nameLabel.textColor = ColorRGB(51, 51, 51);
    [self.contentView addSubview:self.nameLabel];
    
    self.nikeNameLabel = [UILabel new];
    self.nikeNameLabel.font = [UIFont systemFontOfSize:14];
    self.nikeNameLabel.textColor = ColorRGB(102, 102, 102);
    [self.contentView addSubview:self.nikeNameLabel];
    
    self.priceLabel = [UILabel new];
    self.priceLabel.font = [UIFont systemFontOfSize:14];
    self.priceLabel.textColor = ColorRGB(102, 102, 102);
    self.priceLabel.textColor = [UIColor redColor];
    [self.contentView addSubview:self.priceLabel];
    
    
    
    
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        
        make.left.offset(8);
        make.top.offset(15);
        make.right.equalTo(self).offset(-80);
        
    }];
    
    
    [self.nikeNameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.nameLabel);
        make.top.equalTo(self.nameLabel.mas_bottom).offset(15);
        
    }];
    
    
    
    
    
    
    self.priceLabel.text = @"¥0.05";
    [self.priceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self).offset(-8);
        make.centerY.equalTo(self.nikeNameLabel);
        
    }];
    
    
    [self.contentView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.offset(0);
        make.bottom.mas_equalTo(self.nikeNameLabel).offset(15);
    }];
    
    
    
    
    
    
}


@end
